package com.yqg.manage.mapper;

import com.github.yulichang.base.MPJBaseMapper;
import com.yqg.manage.entity.Params;
import io.lettuce.core.dynamic.annotation.Key;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author suzhuang
 * @since 2023-07-05
 */
@Mapper
public interface ParamsMapper extends MPJBaseMapper<Params> {

    @Select("select * from params where case_no = #{caseNo} and template_no in (select template_no from archive where id in (select archive_id from archive_node where node_id = #{nodeId}))")
    List<Params> findLastNodeParams(Integer nodeId, String caseNo);


    /**
     * 根据案件导出文书PDF，返回文书名称和PDF路径的List
     * @return （documentName,pdf）
     */
    @MapKey("documentName")
    List<Map<String, Object>> getPdfList(@Param("caseId") String caseId);
}
